<?php



namespace app\adminapi\controller\user;


use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\user\UserlogLists;
use app\adminapi\logic\user\UserlogLogic;
use app\adminapi\validate\user\UserlogValidate;


/**
 * portal认证记录控制器
 * Class UserlogController
 * @package app\adminapi\controller\user
 */
class UserlogController extends BaseAdminController
{


    /**
     * @notes 获取portal认证记录列表
     * @return \think\response\Json
     * @author gzx
     * @date 2024/07/04 16:31
     */
    public function lists()
    {
        return $this->dataLists(new UserlogLists());
    }


    /**
     * @notes 添加portal认证记录
     * @return \think\response\Json
     * @author gzx
     * @date 2024/07/04 16:31
     */
    public function add()
    {
        $params = (new UserlogValidate())->post()->goCheck('add');
        $result = UserlogLogic::add($params);
        if (true === $result) {
            return $this->success('添加成功', [], 1, 1);
        }
        return $this->fail(UserlogLogic::getError());
    }


    /**
     * @notes 编辑portal认证记录
     * @return \think\response\Json
     * @author gzx
     * @date 2024/07/04 16:31
     */
    public function edit()
    {
        $params = (new UserlogValidate())->post()->goCheck('edit');
        $result = UserlogLogic::edit($params);
        if (true === $result) {
            return $this->success('编辑成功', [], 1, 1);
        }
        return $this->fail(UserlogLogic::getError());
    }


    /**
     * @notes 删除portal认证记录
     * @return \think\response\Json
     * @author gzx
     * @date 2024/07/04 16:31
     */
    public function delete()
    {
        $params = (new UserlogValidate())->post()->goCheck('delete');
        UserlogLogic::delete($params);
        return $this->success('删除成功', [], 1, 1);
    }


    /**
     * @notes 获取portal认证记录详情
     * @return \think\response\Json
     * @author gzx
     * @date 2024/07/04 16:31
     */
    public function detail()
    {
        $params = (new UserlogValidate())->goCheck('detail');
        $result = UserlogLogic::detail($params);
        return $this->data($result);
    }


}